/**
  * author : Frank Luo
  * editor : Bu Heng
  */
Ext.Loader.setConfig({
	enabled : true
});
// Ext.Loader.setPath('Ext.ux', '/TEX/resources/extjs/ux');
Ext.Loader.setPath('Ext.ux', ctx + '/resources/extjs/ux');
Ext.require([ 'Ext.ux.form.MultiSelect', 'Ext.ux.form.ItemSelector' ]);

Ext.define('HIT.view.SetRuleInvoiceGroupWin', {
	extend : 'Ext.window.Window',
	alias : 'widget.mergeWin',
	id : 'MergeWin',
	height : 500,//510
	width : 635,//615
	autoScroll:true,
	resizable:false,
	overlapHeader : false,
	preventHeader : true,
	title : Share.T('发票分组'),

	initComponent : function() {
		var me = this;
		this.title = Share.T('发票分组');
		var myId=1;//用于记录增加删除的fieldset的ID的参数
		var control=0;//用于控制增加位置的参数

		Ext.applyIf(me, {
			items : new Ext.form.Panel({
				xtype : 'fieldset',
				id:'merge_form',//验证页面是否有错误项的ID
				items : [ 
				    {//设置隐藏域放置判断页面是执行增加，还是修改
		            xtype: 'hiddenfield',
		            id: 'merge_rule_id',
		            value: -1
		            },{//第一个框 
					xtype : 'fieldset',
					border:false,
					layout : {
						type : 'absolute'
					},
					height : 130,
					items : [ {
						xtype : 'label',
						x : 5,
						y : 20,
						height : 15,
						text : Share.T('规则ID') + ':'
					}, {
						xtype : 'label',
						id:"merge_rule_detail_id",
						x : 50,
						y : 20,
						height : 15,
						text : ''
					}, {
						xtype : 'label',
						x : 95,
						y : 20,
						height : 15,
						text : Share.T('规则类型') + ':      ' + Share.T('发票分组')
					},
					{
			        	xtype : 'combobox',
			        	x : 255,
						y : 17,
						width:240,
						labelWidth:80,
						editable : false,
						fieldLabel : Share.T('有效范围'),
						id : 'merge_scopeFlag',
						valueField : 'value',
						displayField : 'text',
						value:'0',
						store: new Ext.data.JsonStore({  
	    					proxy: { 
	        	                type: 'ajax', 
	        	                url : ctx + '/getComboData',
	        	                params:{
	        	                },
	        	                reader: { 
	        	                    type: 'json', 
	        	                    totalProperty: '', 
	        	                    root: '' 
	        	                } 
	        	             }, 
	        	            fields:['text','value'], 
	        	            autoLoad:true 
				        }),
				        listeners : {
				        	beforerender:function(){
				        		this.store.removeAll();
				        		this.store.on('beforeload', function(store) {
				        			Ext.apply(store.proxy.extraParams , {
				        				type : 'rulescope'
				        			});
				        		});
				        		this.store.load();
				        	}
				        },
						onChange:function(){
							if(this.value=='1'){								
								Ext.getCmp('merge_cust_code').setValue("");
								Ext.getCmp('merge_cust_name').setValue("");
								Ext.getCmp('merge_cust_code').disable();
								Ext.getCmp('merge_cust_name').disable();
							}else{
								Ext.getCmp('merge_cust_code').enable();
								Ext.getCmp('merge_cust_name').enable();
							}
						}
			      },
					{
						xtype : 'combobox',
						triggerAction : 'query',
						id:'merge_cust_code',
						allowBlank : false,
						msgTarget  : 'side',
						x : 5,
						y : 50,
						labelWidth : 60,
						height : 15,
						width : 220,
						editable : true,
						minChars : 1,
						fieldLabel : Share.T('客户'),
						selectOnFocus : true,
						valueField : 'name',
						displayField : 'code',
						hideTrigger : true, // 隐藏下拉箭头
						typeAhead : false,
						queryDelay : 20,
						store : new Ext.data.JsonStore({
							proxy: { 
								type: 'ajax', 
								url : ctx + '/getCustInfo',
								params:{
								},
								reader: { 
									type: 'json', 
									totalProperty: '', 
									root: '' 
								} 
							}, 
						fields:['name','code'], 
      	            autoLoad:true 
			          }),
      				listeners : {
    					beforequery : function(e) {
        					var combo = e.combo;   
        					if(!e.forceAll){   
        						var value = e.query;   
        						combo.store.filterBy(function(record,id){   
        							var text = record.get(combo.displayField); 
        							return (text.indexOf(value)!=-1);   
        						});
        						combo.expand();   
        						return false;   
        					}
    					},
    					//选择后更改label的text
			      		select:function(e){
			      			var value=Ext.getCmp('merge_cust_code').getValue();//得到此下拉框的value
        					Ext.getCmp("merge_cust_name").setValue(value);//设定label的text
			      		}
    				}
					}, {//客户名称
						xtype : 'combobox',
						triggerAction : 'query',
						id:'merge_cust_name',
						allowBlank : false,
						msgTarget  : 'side',
						hideTrigger : true, // 隐藏下拉箭头
						selectOnFocus : true,
						fieldLabel : Share.T('客户名称'),
						x : 255,
						y : 50,
						labelWidth : 80,
						height : 15,
						width : 240,
						text : "",
						valueField : 'code',
						displayField : 'name',
						typeAhead : false,
						queryDelay : 20,
						store : new Ext.data.JsonStore({
							proxy: { 
								type: 'ajax', 
								url : ctx + '/getCustInfo',
								params:{
								},
								reader: { 
									type: 'json', 
									totalProperty: '', 
									root: '' 
								} 
							}, 
						fields:['code','name'], 
      	            autoLoad:true 
			          }),
			          listeners : {
	    					beforequery : function(e) {
	        					var combo = e.combo;   
	        					if(!e.forceAll){   
	        						var value = e.query;   
	        						combo.store.filterBy(function(record,id){   
	        							var text = record.get(combo.displayField); 
	        							return (text.indexOf(value)!=-1);   
	        						});
	        						combo.expand();   
	        						return false;   
	        					}
	    					},
	    					//选择后更改label的text
				      		select:function(e){
				      			var value=Ext.getCmp('merge_cust_name').getValue();//得到此下拉框的value
	        					Ext.getCmp("merge_cust_code").setValue(value);//设定label的text
				      		}
	    				}
					}, {
						xtype : 'textfield',
						id:'merge_remark',
						x : 5,
						y : 80,
						width : 490,
						fieldLabel : Share.T('备注'),
						labelWidth : 60,
						maxLength : 100,
						msgTarget  : 'side'
					}]
				},
				//第二个框（发票分组条件）
				{
					xtype : 'fieldset',
					title : Share.T('发票分组条件'),
					id:'merge_condition',
					x:10,
					width:500,
					items : [ {
						xtype : 'panel',
						margin: '10 0 10',
						id:'merge'+myId,
						layout : {
							type : 'absolute'
						},
						border : false,
						height: 24,
						items : [ {
							xtype : 'combobox',
							id:'merge_combo'+myId,
							triggerAction : 'all',
							x : 65,
							width : 110,
							msgTarget  : 'side',
							editable:false,
							minChars : 1,
							selectOnFocus : true,
							queryMode: 'local',
							valueField : 'value',
							displayField : 'code',
							typeAhead : false,
							queryDelay : 20,
							renderTo: Ext.getBody(),
							store : new Ext.data.JsonStore({
								proxy: {
									type: 'ajax', 
									url : ctx + '/getCommonConditions',
									params:{},
									reader: { 
										type: 'json', 
										totalProperty: '', 
										root: '' 
									} 
								}, 
								fields:['value','code'],
								autoLoad:true
							}),
							listeners : {
								expand : function(field, e) {
									var store = field.store; 
									if(!field.forceAll){
										store.filterBy(function(record,id){   
											var text = record.get(field.valueField); 
											return (text.indexOf('D_'));   
										});
									}
								}
							}
						}, {
							xtype : 'button',
							id:'delete',
							x : 185,
							width : 60,
							text : Share.T('删除'),
							onClick:function(){
								var condition=Ext.getCmp('merge_condition');
								condition.remove(this.findParentByType('panel'));
								control--;
							}
						} ]
					},{
						xtype : 'panel',
						margin: '10 0 10',
						layout : {
							type : 'absolute'
						},
						height: 24,
						border:false,
						items : [ {
							xtype : 'button',
							x : 185,
							width : 60,
	                        id:'merge_condition_add',
							text : Share.T('增加'),
							handler:function(){
								myId++;
								var newField=new Ext.form.Panel({
								    margin: '10 0 10',
								    height: 24,
									id:'merge'+myId,
									layout : {
										type : 'absolute'
									},
									border : false,
									items : [ {
										xtype : 'combobox',
										id:'merge_combo'+myId,
										triggerAction : 'all',
										x : 65,
										width : 110,
										msgTarget  : 'side',
										editable:false,
										minChars : 1,
										selectOnFocus : true,
										queryMode: 'local',
										valueField : 'value',
										displayField : 'code',
										typeAhead : false,
										queryDelay : 20,
										store : new Ext.data.JsonStore({
											proxy: {
												type: 'ajax', 
												url : ctx + '/getCommonConditions',
												params:{},
												reader: { 
													type: 'json', 
													totalProperty: '', 
													root: '' 
												} 
											}, 
											fields:['value','code'],
											autoLoad:true
										}),
										listeners : {
											expand : function(field, e) {
												var store = field.store; 
												if(!field.forceAll){
													store.filterBy(function(record,id){   
														var text = record.get(field.valueField); 
														return (text.indexOf('D_'));   
													});
												}
											}
										}
									}, {
										xtype : 'button',
										x : 185,
										width : 60,
										text : Share.T('删除'),
										onClick:function(){
											var condition=Ext.getCmp('merge_condition');
											condition.remove(this.findParentByType('panel'));
											control--;
										}
									} ]
								});
								control++;
								Ext.getCmp('merge_condition').insert(control,newField);//在insert的位置插入       
								Ext.getCmp('merge_condition').doLayout();  //显示出来
							}
						} ]
					} ]
				},
				//第三个框（转换处理）
				{
					xtype : 'fieldset',
					height : 160,
					x:10,
					width:580,
					layout : {
						type : 'absolute'
					},
					title : Share.T('转换处理'),
					items : [ {
						xtype : 'combobox',
						id:'merge_conversion_combo01',
						editable:false,//下拉列表不允许输入
						fieldLabel : Share.T('数量'),
						labelWidth : 40,
						triggerAction:"all",
						name :'merge_conversion1',
						x : 30,
						y : 5,
						width : 120,
						height : 15,
						minChars : 1,
						selectOnFocus : true,
						valueField : 'value',
						displayField : 'text',
						typeAhead : false,
						queryDelay : 20,
						model: 'local',
						queryMode:'local',
						value:'00',
						store: new Ext.data.JsonStore({  
	    					proxy: { 
	        	                type: 'ajax', 
	        	                url : ctx + '/getComboData',
	        	                params:{
	        	                },
	        	                reader: { 
	        	                    type: 'json', 
	        	                    totalProperty: '', 
	        	                    root: '' 
	        	                } 
	        	             }, 
	        	            fields:['text','value'], 
	        	            autoLoad:true 
				        }),
				        listeners : {
				        	beforerender:function(){
				        		this.store.removeAll();
				        		this.store.on('beforeload', function(store) {
				        			Ext.apply(store.proxy.extraParams , {
				        				type : 'ruleadjust'
				        			});
				        		});
				        		this.store.load();
				        	},
				        	expand : function(field, e) {
				        		this.store.filterBy(function(record,id){
				        			var retValue = record.get("value");
				                     if(retValue == '00' || retValue == '06' || retValue == '07'){
				                         return true;
				                     }
				        		});
				        	},
				        	select : function(){
				        		onChange : {
									if (this.value == '07') {
										Ext.getCmp('merge_conversion_text01').enable();
										Ext.getCmp('merge_conversion_combo02').setValue("06");
										Ext.getCmp('merge_conversion_text02').setValue("");
										Ext.getCmp('merge_conversion_text02').disable();
									} else if (this.value == '06') {
										Ext.getCmp('merge_conversion_combo02').setValue("00");
										Ext.getCmp('merge_conversion_text01').setValue("");
										Ext.getCmp('merge_conversion_text01').disable();
										Ext.getCmp('merge_conversion_text02').disable();
									} else if (this.value == '00') {
										Ext.getCmp('merge_conversion_text01').disable();
										Ext.getCmp('merge_conversion_combo02').setValue("06");
										Ext.getCmp('merge_conversion_text02').setValue("");
										Ext.getCmp('merge_conversion_text02').disable();
									}
								}
				        	}
				        }
					}, {
						xtype : 'numberfield',
						id:'merge_conversion_text01',
						hideTrigger:true,
						maxValue:100000000,
						minValue:0.000001,
						decimalPrecision:6,
						allowBlank : false,
						x : 160,
						y : 5,
						maxLength:200,
						msgTarget : "side",
						width : 100,
						disabled:true
					}, {
						xtype : 'combobox',
						id:'merge_conversion_combo02',
						editable:false,//下拉列表不允许输入
						fieldLabel : Share.T('单价'),
						labelWidth : 40,
						triggerAction:"all",
						name :'merge_conversion2',
						x : 300,
						y : 5,
						width : 120,
						height : 15,
						minChars : 1,
						selectOnFocus : true,
						valueField : 'value',
						displayField : 'text',
						typeAhead : false,
						queryDelay : 20,
						model: 'local',
						queryMode:'local',
						value:'06',
						store: new Ext.data.JsonStore({  
	    					proxy: { 
	        	                type: 'ajax', 
	        	                url : ctx + '/getComboData',
	        	                params:{
	        	                },
	        	                reader: { 
	        	                    type: 'json', 
	        	                    totalProperty: '', 
	        	                    root: '' 
	        	                } 
	        	             }, 
	        	            fields:['text','value'], 
	        	            autoLoad:true 
				        }),
				        listeners : {
				        	beforerender:function(){
				        		this.store.removeAll();
				        		this.store.on('beforeload', function(store) {
				        			Ext.apply(store.proxy.extraParams , {
				        				type : 'ruleadjust'
				        			});
				        		});
				        		this.store.load();
				        	},
				        	expand : function(field, e) {
				        		this.store.filterBy(function(record,id){
				        			var retValue = record.get("value");
				                     if(retValue == '00' || retValue == '06' || retValue == '07'){
				                         return true;
				                     }
				        		});
				        	},
				        	select : function(){
				        		onChange : {
									if(this.value=='07'){								
										Ext.getCmp('merge_conversion_text02').enable();
										Ext.getCmp('merge_conversion_combo01').setValue('06');
										Ext.getCmp('merge_conversion_text01').setValue("");
										Ext.getCmp('merge_conversion_text01').disable();
									}else if (this.value=='06') {
										Ext.getCmp('merge_conversion_text02').setValue("");
										Ext.getCmp('merge_conversion_text02').disable();
										Ext.getCmp('merge_conversion_combo01').setValue('00');
										Ext.getCmp('merge_conversion_text01').setValue("");
										Ext.getCmp('merge_conversion_text01').disable();
									}else if (this.value=='00') {
										Ext.getCmp('merge_conversion_text02').disable();
										Ext.getCmp('merge_conversion_combo01').setValue('06');
										Ext.getCmp('merge_conversion_text01').setValue("");
										Ext.getCmp('merge_conversion_text01').disable();
									}
								}
				        	}
				        }
					} , {
						xtype : 'numberfield',
						id:'merge_conversion_text02',
						hideTrigger:true,
						maxValue:100000000,
						minValue:0.000001,
						decimalPrecision:6,
						allowBlank : false,
						x : 430,
						y : 5,
						maxLength:200,
						msgTarget : "side",
						width : 100,
						disabled:true
					},{
						xtype : 'combobox',
						id:'merge_conversion_combo03',
						editable:false,//下拉列表不允许输入
						fieldLabel : Share.T('商品名'),
						labelWidth : 40,
						triggerAction : 'all',
						x : 30,
						y : 30,
						width : 120,
						height : 15,
						minChars : 1,
						selectOnFocus : true,
						valueField : 'value',
						displayField : 'text',
						typeAhead : false,
						queryDelay : 20,
						value:'00',
						model: 'local',
						queryMode:'local',
						store: new Ext.data.JsonStore({  
	    					proxy: { 
	        	                type: 'ajax', 
	        	                url : ctx + '/getComboData',
	        	                params:{
	        	                },
	        	                reader: { 
	        	                    type: 'json', 
	        	                    totalProperty: '', 
	        	                    root: '' 
	        	                } 
	        	             }, 
	        	            fields:['text','value'], 
	        	            autoLoad:true 
				        }),
				        listeners : {
				        	beforerender:function(){
				        		this.store.removeAll();
				        		this.store.on('beforeload', function(store) {
				        			Ext.apply(store.proxy.extraParams , {
				        				type : 'ruleadjust'
				        			});
				        		});
				        		this.store.load();
				        	},
				        	expand : function(field, e) {
				        		this.store.filterBy(function(record,id){
				        			var retValue = record.get("value");
				                     if(retValue == '00' || retValue == '02' || retValue == '04'|| retValue == '07'){
				                         return true;
				                     }
				        		});
				        	}
				        },
						onChange:function(){
							if(this.value=='07'){								
								Ext.getCmp('merge_conversion_text03').enable();
							}else{
								Ext.getCmp('merge_conversion_text03').setValue("");
								Ext.getCmp('merge_conversion_text03').disable();
							}
						}
					}, {
						xtype : 'textfield',
						id:'merge_conversion_text03',
						x : 160,
						y : 30,
						maxLength:200,
						msgTarget:"side",
						width : 100,
						disabled:true
					}, {
						xtype : 'combobox',
						id:'merge_conversion_combo04',
						editable:false,//下拉列表不允许输入
						fieldLabel : Share.T('规格'),
						labelWidth : 40,
						triggerAction : 'all',
						x : 300,
						y : 30,
						width : 120,
						height : 15,
						minChars : 1,
						selectOnFocus : true,
						valueField : 'value',
						displayField : 'text',
						typeAhead : false,
						queryDelay : 20,
						value:'00',
						model: 'local',
						queryMode:'local',
						store: new Ext.data.JsonStore({  
	    					proxy: { 
	        	                type: 'ajax', 
	        	                url : ctx + '/getComboData',
	        	                params:{
	        	                },
	        	                reader: { 
	        	                    type: 'json', 
	        	                    totalProperty: '', 
	        	                    root: '' 
	        	                } 
	        	             }, 
	        	            fields:['text','value'], 
	        	            autoLoad:true 
				        }),
				        listeners : {
				        	beforerender:function(){
				        		this.store.removeAll();
				        		this.store.on('beforeload', function(store) {
				        			Ext.apply(store.proxy.extraParams , {
				        				type : 'ruleadjust'
				        			});
				        		});
				        		this.store.load();
				        	},
				        	expand : function(field, e) {
				        		this.store.filterBy(function(record,id){
				        			var retValue = record.get("value");
				                     if(retValue == '00' || retValue == '02' || retValue == '04'|| retValue == '07'){
				                         return true;
				                     }
				        		});
				        	}
				        },
						onChange:function(){
							if(this.value=='07'){								
								Ext.getCmp('merge_conversion_text04').enable();
							}else{
								Ext.getCmp('merge_conversion_text04').setValue("");
								Ext.getCmp('merge_conversion_text04').disable();
							}
						}
					} , {
						xtype : 'textfield',
						id:'merge_conversion_text04',
						x : 430,
						y : 30,
						maxLength:200,
						msgTarget:"side",
						width : 100,
						disabled:true
					},{
						xtype : 'combobox',
						id:'merge_conversion_combo05',
						editable:false,//下拉列表不允许输入
						fieldLabel : Share.T('单位'),
						labelWidth : 40,
						triggerAction : 'all',
						x : 30,
						y : 55,
						width : 120,
						height : 15,
						minChars : 1,
						selectOnFocus : true,
						valueField : 'value',
						displayField : 'text',
						typeAhead : false,
						queryDelay : 20,
						value:'00',
						model: 'local',
						queryMode:'local',
						store: new Ext.data.JsonStore({  
	    					proxy: { 
	        	                type: 'ajax', 
	        	                url : ctx + '/getComboData',
	        	                params:{
	        	                },
	        	                reader: { 
	        	                    type: 'json', 
	        	                    totalProperty: '', 
	        	                    root: '' 
	        	                } 
	        	             }, 
	        	            fields:['text','value'], 
	        	            autoLoad:true 
				        }),
				        listeners : {
				        	beforerender:function(){
				        		this.store.removeAll();
				        		this.store.on('beforeload', function(store) {
				        			Ext.apply(store.proxy.extraParams , {
				        				type : 'ruleadjust'
				        			});
				        		});
				        		this.store.load();
				        	},
				        	expand : function(field, e) {
				        		this.store.filterBy(function(record,id){
				        			var retValue = record.get("value");
				                     if(retValue == '00' || retValue == '02' || retValue == '04'|| retValue == '07'){
				                         return true;
				                     }
				        		});
				        	}
				        },
						onChange:function(){
							if(this.value=='07'){								
								Ext.getCmp('merge_conversion_text05').enable();
							}else{
								Ext.getCmp('merge_conversion_text05').setValue("");
								Ext.getCmp('merge_conversion_text05').disable();
							}
						}
					}, {
						xtype : 'textfield',
						id:'merge_conversion_text05',
						x : 160,
						y : 55,
						maxLength:200,
						msgTarget:"side",
						width : 100,
						disabled:true
					}, {
						xtype : 'combobox',
						id:'merge_conversion_combo06',
						editable:false,//下拉列表不允许输入
						fieldLabel : Share.T('备注'),
						labelWidth : 40,
						triggerAction : 'all',
						x : 300,
						y : 55,
						width : 120,
						height : 15,
						minChars : 1,
						selectOnFocus : true,
						valueField : 'value',
						displayField : 'text',
						typeAhead : false,
						queryDelay : 20,
						value:'00',
						model: 'local',
						queryMode:'local',
						store: new Ext.data.JsonStore({  
	    					proxy: { 
	        	                type: 'ajax', 
	        	                url : ctx + '/getComboData',
	        	                params:{
	        	                },
	        	                reader: { 
	        	                    type: 'json', 
	        	                    totalProperty: '', 
	        	                    root: '' 
	        	                } 
	        	             }, 
	        	            fields:['text','value'], 
	        	            autoLoad:true 
				        }),
				        listeners : {
				        	beforerender:function(){
				        		this.store.removeAll();
				        		this.store.on('beforeload', function(store) {
				        			Ext.apply(store.proxy.extraParams , {
				        				type : 'ruleadjust'
				        			});
				        		});
				        		this.store.load();
				        	},
				        	expand : function(field, e) {
				        		this.store.filterBy(function(record,id){
				        			var retValue = record.get("value");
				                     if(retValue == '00' || retValue == '02' || retValue == '04'|| retValue == '07'){
				                         return true;
				                     }
				        		});
				        	}
				        },
						onChange:function(){
							if(this.value=='07'){								
								Ext.getCmp('merge_conversion_text06').enable();
							}else{
								Ext.getCmp('merge_conversion_text06').setValue("");
								Ext.getCmp('merge_conversion_text06').disable();
							}
						}
					} , {
						xtype : 'textfield',
						id:'merge_conversion_text06',
						x : 430,
						y : 55,
						maxLength:200,
						msgTarget:"side",
						width : 100,
						disabled:true
					},{
						xtype : 'combobox',
						id:'merge_conversion_combo07',
						editable:false,//下拉列表不允许输入
						fieldLabel : Share.T('摘要'),
						labelWidth : 40,
						triggerAction : 'all',
						x : 30,
						y : 80,
						width : 120,
						height : 15,
						minChars : 1,
						selectOnFocus : true,
						valueField : 'value',
						displayField : 'text',
						typeAhead : false,
						queryDelay : 20,
						value:'00',
						model: 'local',
						queryMode:'local',
						store: new Ext.data.JsonStore({  
	    					proxy: { 
	        	                type: 'ajax', 
	        	                url : ctx + '/getComboData',
	        	                params:{
	        	                },
	        	                reader: { 
	        	                    type: 'json', 
	        	                    totalProperty: '', 
	        	                    root: '' 
	        	                } 
	        	             }, 
	        	            fields:['text','value'], 
	        	            autoLoad:true 
				        }),
				        listeners : {
				        	beforerender:function(){
				        		this.store.removeAll();
				        		this.store.on('beforeload', function(store) {
				        			Ext.apply(store.proxy.extraParams , {
				        				type : 'ruleadjust'
				        			});
				        		});
				        		this.store.load();
				        	},
				        	expand : function(field, e) {
				        		this.store.filterBy(function(record,id){
				        			var retValue = record.get("value");
				                     if(retValue == '00' || retValue == '02' || retValue == '04'|| retValue == '07'){
				                         return true;
				                     }
				        		});
				        	}
				        },
						onChange:function(){
							if(this.value=='07'){								
								Ext.getCmp('merge_conversion_text07').enable();
							}else{
								Ext.getCmp('merge_conversion_text07').setValue("");
								Ext.getCmp('merge_conversion_text07').disable();
							}
						}
					}, {
						xtype : 'textfield',
						id:'merge_conversion_text07',
						x : 160,
						y : 80,
						maxLength:200,
						msgTarget:"side",
						width : 100,
						disabled:true
					} ]
				} ]
			}),
			buttons : [ {
				xtype : 'button',
				id:'merge_save',
				width : 45,
				text : Share.T('保存')
			}, 
			{
				xtype : 'button',
				id:'merge_copy',
				width : 45,
				text : Share.T('复制'),
				handler : function()
				{ 
					if(Ext.getCmp('merge_rule_id').getValue()!=-1)
						{
						   Share.ShowMessage('I0057');
						   Ext.getCmp('merge_rule_detail_id').setText('');
						   this.disable();
						   Ext.getCmp('merge_delete').disable();
						   Ext.getCmp('merge_rule_id').setValue(-1);
						   Ext.getCmp('merge_scopeFlag').enable();
					if(Ext.getCmp('merge_scopeFlag').getValue() != 1)
						{
						   Ext.getCmp('merge_cust_code').enable();
						   Ext.getCmp('merge_cust_name').enable();
						}
					}
				}
			}, {
				xtype : 'button',
				id:'merge_delete',
				// disabled:true,
				width : 45,
				text : Share.T('删除')
			}, {
				xtype : 'button',
				id:'merge_close',
				width : 45,
				text : Share.T('取消')
			}]
		});
		me.callParent(arguments);
	}
});

